/*
 * Copyright (C) 2010-2011 Comcast Cable.  All Rights Reserved.
 */
package com.hercules.android.receiver.model.objects;

/**
 * <p>This class represents the image resource which allows a JPEG, GIF or PNG file to be placed in one or more places
 * in the view hierarchy. The location of the image is provided to the receiver via a URL; and the receiver is required
 * to load the image using a dedicated socket connection (cannot reuse same socket being used to exchange XRE messages).
 * It is a simple JavaBean (POJO) that provides getters and setters for all private attributes and performs no argument
 * validation in the setters.</p>
 *
 * <p><strong>Thread safety:</strong> This class is mutable and not thread safe.</p>
 *
 * @author saarixx, jmn
 * @version 1.0
 */
public class XREImage extends XREResource {

    /**
     * <p>The URL to the image file.</p>
     *
     * <p>Can be any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    private String url;

    /**
     * <p>The image quality.</p>
     *
     * <p>Can be any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    private XREImageQuality quality = XREImageQuality.HIGH;

    /**
     * <p>Creates new instance of {@link XREImage} class.</p>
     */
    public XREImage() {
        // empty constructor
    }

    /**
     * <p>Retrieves the URL to the image file.</p>
     *
     * @return the URL to the image file
     */
    public String getUrl() {
        return url;
    }

    /**
     * <p>Sets the URL to the image file.</p>
     *
     * @param url the URL to the image file
     */
    public void setUrl(String url) {
        this.url = url;
    }

    /**
     * <p>Retrieves the image quality.</p>
     *
     * @return the image quality
     */
    public XREImageQuality getQuality() {
        return quality;
    }

    /**
     * <p>Sets the image quality.</p>
     *
     * @param quality the image quality
     */
    public void setQuality(XREImageQuality quality) {
        this.quality = quality;
    }
}

